#!/bin/bash

# if mac os, then  sed -i  "" 's/old/new/g' file
sed -i "s/ZK_CLUSTER_ALIAS/${ZK_CLUSTER_ALIAS}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/ZK_LOCAL/${ZK_LOCAL}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/ZK_DEV/${ZK_DEV}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/ZK_TEST/${ZK_TEST}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/MYSQL_URL/${MYSQL_URL}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/MYSQL_USER/${MYSQL_USER}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/MYSQL_PWD/${MYSQL_PWD}/g" /kafka-eagle/conf/system-config.properties
sed -i "s/MYSQL_DATABASE/${MYSQL_DATABASE}/g" /kafka-eagle/conf/system-config.properties

chmod +x /kafka-eagle/bin/ke.sh
mkdir -p /kafka-eagle/db/
sh /kafka-eagle/bin/ke.sh start
tail -f /kafka-eagle/logs/log.log